home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / lang / Python16_Src.lha / Python16_Source / Include / longobject.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-03  |  1.8 KB  |  60 lines

  1. #ifndef Py_LONGOBJECT_H
  2. #define Py_LONGOBJECT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. /* Long (arbitrary precision) integer object interface */
  8.  
  9. typedef struct _longobject PyLongObject; /* Revealed in longintrepr.h */
  10.  
  11. extern DL_IMPORT(PyTypeObject) PyLong_Type;
  12.  
  13. #define PyLong_Check(op) ((op)->ob_type == &PyLong_Type)
  14.  
  15. extern DL_IMPORT(PyObject *) PyLong_FromLong Py_PROTO((long));
  16. extern DL_IMPORT(PyObject *) PyLong_FromUnsignedLong Py_PROTO((unsigned long));
  17. extern DL_IMPORT(PyObject *) PyLong_FromDouble Py_PROTO((double));
  18. extern DL_IMPORT(long) PyLong_AsLong Py_PROTO((PyObject *));
  19. extern DL_IMPORT(unsigned long) PyLong_AsUnsignedLong Py_PROTO((PyObject *));
  20. extern DL_IMPORT(double) PyLong_AsDouble Py_PROTO((PyObject *));
  21. extern DL_IMPORT(PyObject *) PyLong_FromVoidPtr Py_PROTO((void *));
  22. extern DL_IMPORT(void *) PyLong_AsVoidPtr Py_PROTO((PyObject *));
  23.  
  24. #ifdef HAVE_LONG_LONG
  25.  
  26. #ifdef HAVE_LIMITS_H
  27. #include <limits.h>
  28. #endif
  29.  
  30. /* Hopefully this is portable... */
  31. #ifndef LONG_MAX
  32. #define LONG_MAX 2147483647L
  33. #endif
  34. #ifndef ULONG_MAX
  35. #define ULONG_MAX 4294967295U
  36. #endif
  37. #ifndef LONGLONG_MAX
  38. #define LONGLONG_MAX 9223372036854775807LL
  39. #endif
  40. #ifndef ULONGLONG_MAX
  41. #define ULONGLONG_MAX 0xffffffffffffffffULL
  42. #endif
  43. #ifndef LONG_LONG
  44. #define LONG_LONG long long
  45. #endif
  46.  
  47. extern DL_IMPORT(PyObject *) PyLong_FromLongLong Py_PROTO((LONG_LONG));
  48. extern DL_IMPORT(PyObject *) PyLong_FromUnsignedLongLong Py_PROTO((unsigned LONG_LONG));
  49. extern DL_IMPORT(LONG_LONG) PyLong_AsLongLong Py_PROTO((PyObject *));
  50. extern DL_IMPORT(unsigned LONG_LONG) PyLong_AsUnsignedLongLong Py_PROTO((PyObject *));
  51. #endif /* HAVE_LONG_LONG */
  52.  
  53. DL_IMPORT(PyObject *) PyLong_FromString Py_PROTO((char *, char **, int));
  54. DL_IMPORT(PyObject *) PyLong_FromUnicode Py_PROTO((Py_UNICODE*, int, int));
  55.  
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif /* !Py_LONGOBJECT_H */
  60.